<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
      
    </ma-crud>
  </div>
</template>
<script setup>
import {ref, reactive} from 'vue'
import shippingSchedule from '@/api/document/shippingSchedule'
import useShippingSchedule from "@/utils/crud/useShippingSchedule.js";

const crudRef = ref()

const options = reactive({
  id: 'shipping_schedule',
  pageLayout: 'fixed',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: true,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'modal',
    width: '60%',
    layout: useShippingSchedule.layout
  },
  api: shippingSchedule.getList,
  recycleApi: shippingSchedule.getRecycleList,
  tabs: {
    dataIndex: 'type',
    searchIndex: 'type'
  },
  add: {
    show: true,
    api: shippingSchedule.save,
    auth: ['document:shippingSchedule:save']
  },
  edit: {
    show: true,
    api: shippingSchedule.update,
    auth: ['document:shippingSchedule:update']
  },
  delete: {
    show: true,
    api: shippingSchedule.deletes,
    auth: ['document:shippingSchedule:delete'],
    realApi: shippingSchedule.realDeletes,
    realAuth: ['document:shippingSchedule:realDeletes']
  },
  recovery: {
    show: true,
    api: shippingSchedule.recoverys,
    auth: ['document:shippingSchedule:recovery']
  }
})

const columns = useShippingSchedule.columns
</script>
